package com.baichuan.controller.stickyNote;

import com.alibaba.fastjson.JSONObject;
import com.baichuan.service.stickyNote.StickyNoteService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author ldy
 * @Date 2022/8/2 9:24
 * @Description
 **/
@RestController
@Slf4j
@RequestMapping("StickyNote")
public class StickyNoteController {

    @Autowired
    StickyNoteService stickyNoteService;

    /**
     * 新增
     * @param params
     * @return
     */
    @PostMapping("insert")
    public String insert(@RequestBody JSONObject params){
        return stickyNoteService.insert(params);
    }

    /**
     * 修改
     * @param params
     * @return
     */
    @PostMapping("update")
    public String update(@RequestBody JSONObject params){
        return stickyNoteService.update(params);
    }

    /**
     * 删除
     * @param params
     * @return
     */
    @PostMapping("delete")
    public String delete(@RequestBody JSONObject params){
        return stickyNoteService.delete(params);
    }

    /**
     * 查询
     * @param params
     * @return
     */
    @PostMapping("list")
    public String query(@RequestBody JSONObject params){
        return stickyNoteService.list(params);
    }

}
